package com.cps.match.xmlparser;

import org.apache.commons.beanutils.BeanUtils;
import org.apache.commons.lang3.StringUtils;

import com.cps.match.sdo.MatchValueType;

public class MatchValueHelper {
	public static void assignValue(final Object obj, String prop, String value) {
		try {
			if (MatchValueType.isValid(value)) {
				BeanUtils.copyProperty(obj, StringUtils.uncapitalize(prop), MatchValueType.fromValueOf(value));
			}
		} catch (Exception e) {
			throw new RuntimeException(e);
		}
	}

}
